/**
 * 
 */
package t4j.innerclasses;

/**
 * @author sz
 *
 * create time：2012-9-21
 */

abstract class Base{
	public Base(int i){
		System.out.println("Base constructor. i = " + i);
	}
	
	public abstract void f();
}

public class AnonymousConstructor {

	public static Base getBase(int i){
		return new Base(i){
			{System.out.println("实例初始化");}
			
			public void f(){
				System.out.println("In anonymous f()");
			}
		};
	}
	
	public static void main(String[] args) {
		Base b = getBase(47);
		
		b.f();
	}
}
